package com.cwd.arm.common.enums;

/**
 * Created by yan on 21-11-28.
 */
public enum PayTypeEnum {

    CASH("CASH", "现金"),
    HONOR("HONOR", "承兑"),
    PAY_OTHER("HONOR_OTHER", "其他");


    String code; // 状态编号
    String name; //状态名称

    PayTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static String getName(String code) {
        for (PayTypeEnum payTypeEnum : PayTypeEnum.values()) {
            if (payTypeEnum.getCode().equals(code)) {
                return payTypeEnum.getName();
            }
        }
        return null;
    }
}
